<?php
require_once( '../system/smarty.inc' );
require_once( '../system/mdao/Class_M_INS_SHOP_SHOP.php' );
require_once( '../system/mdao/Class_M_OTHER.php' );
require_once( '../system/Class_ERROR.php' );
require_once( '../system/Class_PWD.php' );
require_once( '../system/login.inc.php' );

Class_PWD::valid_auth(AOKI_AUTH_DNP_AREA, $login['staff_auth']);

$dao = new Class_M_INS_SHOP_SHOP;
//$pattern  = Class_M_OTHER::get_pattern_array(NULL, '23' );
//print_r($pattern);


	$dao->setTableNameWeek($_GET['w']);
	$pattern_name = $_GET['pnm'];
	$disp_head = $pattern_name . "&nbsp;&nbsp;" .$_GET['tnm'] . "&nbsp;&nbsp;" .$dao->getShopName( $_GET['id'] ) . "&nbsp;&nbsp;"; 
	
	
	$datas  = $dao->getdnpwByShopcd($_GET['id'], $_GET['pcd']);
	$page["cnt"] = count($datas); 
	foreach ($datas as $k=>$v) {
		$datas[$k]["pattern_name"] = $v["area_pattern_cd"] == "" ? "": $pattern_name ;
	}

	if( isset( $datas ) ) $smarty->assign('data', $datas);
	if( isset( $page ) )  $smarty->assign('page', $page);
	$smarty->assign('disp_head', $disp_head );

	
/*
	$smarty->assign('phase', $phase );
	$smarty->assign('menu', $smarty->fetch('menu.html') );
	$smarty->assign('logout', $smarty->fetch('logout.html') );
	$smarty->assign('footer', $smarty->fetch('footer.html') );
*/
	$smarty->display('ddnpwarea_form_pat3.html');
	

	
?>